interface IRouteChild {
    path:string
    name?:string
    component:string
    wrappers?: string[]

}
interface IRouter {
    path: string
    component?: string
    name?: string // 兼容此写法
    icon?: string
    // 新页面打开 - 可选参数 - ？
    target?: string
    // 不展示顶栏
    headerRender?: boolean,
    // 不展示页脚
    footerRender?: boolean,
    // 不展示菜单
    menuRender?: boolean,
    // 不展示菜单顶栏
    menuHeaderRender?: boolean,
    // 权限配置，需要与 plugin-access 插件配合使用
    access?: string,
    // 隐藏子菜单
    hideChildrenInMenu?: boolean,
    // 隐藏自己和子菜单
    hideInMenu?: boolean,
    // 在面包屑中隐藏
    hideInBreadcrumb?: boolean,
    // 子项往上提，仍旧展示,
    flatMenu?: boolean,
    routes?: Array<IRouteChild>,
    redirect?:any,
    exact?:boolean,
    wrappers?: string[]
}
export const routes: Array<IRouter> = [
    {
        path:'/',
        exact:true,
        redirect:'/home'
    },
    {
        path:'/home',
        name:'首页',
        component:'@/pages/home/index',
        // icon:'https://dss0.bdstatic.com/-0U0bnSm1A5BphGlnYG/tam-ogel/06fbb0142ae29305d485207693b9b6c6_88_88.png'
        icon:'HomeOutlined',
        wrappers: [
            '@/wrappers/auth',
        ],
    },
    {
        path:'/login',
        menuRender: false,
        headerRender: false,
        component:'@/pages/login/index',
        footerRender: false,
    },
    {
        path:'/banner',
        name:'轮播图',
        // icon:'https://dss0.bdstatic.com/-0U0bnSm1A5BphGlnYG/tam-ogel/06fbb0142ae29305d485207693b9b6c6_88_88.png'
        icon:'PictureOutlined',
        routes:[
            {
                path:'/banner/index',
                name:'图库管理',
                component:'@/pages/banner/index',
                wrappers: [
                    '@/wrappers/auth',
                ],
            },
            {
                path:'/banner/list',
                name:'轮播图列表',
                component:'@/pages/banner/list',
                wrappers: [
                    '@/wrappers/role',
                ],
            }
        ]
    },
    {
        path:'/list',
        name:'商品列表',
        icon:'ShoppingCartOutlined',
        routes:[
            {
                path:'/list/shop',
                name:'产品列表',
                component:'@/pages/list/shop',
                wrappers: [
                    '@/wrappers/auth',
                ],
            },
            {
                path:'/list/recommend',
                name:'推荐列表',
                component:'@/pages/list/recommend',
                wrappers: [
                    '@/wrappers/auth',
                ],
            },
            {
                path:'/list/seckill',
                name:'秒杀列表',
                component:'@/pages/list/seckill',
                wrappers: [
                    '@/wrappers/auth',
                ],
            }
        ]
    },
    {
        path: '/form',
        name: '表单管理',
        icon: 'FormOutlined',
        routes: [
          {
            path: '/form/braft',
            name: '富文本编辑器',
            component: '@/pages/form/braft.jsx',
          }
        ]
    },
    {
        path: '/chart',
        name: '数据统计',
        icon: 'AreaChartOutlined',
        routes: [
          {
            path: '/chart/index',
            name: '图表展示',
            component: '@/pages/chart/index',
          }
        ]
      },
      {
        path: '/people',
        name: '人员管理',
        icon: 'TeamOutlined',
        routes: [
          {
            path: '/people/admin',
            name: '管理员列表',
            component: '@/pages/people/admin',
            wrappers: [
              '@/wrappers/role',
          ],
          },
          {
            path: '/people/user',
            name: '用户管理',
            component: '@/pages/people/user',
            wrappers: [
              '@/wrappers/role',
          ],
          },
          {
            path: '/people/addAdmin',
            component: '@/pages/people/addAdmin',
            wrappers: [
              '@/wrappers/role',
          ],
          },
          {
            path: '/people/changeAdmin',
            component: '@/pages/people/changeAdmin',
            wrappers: [
              '@/wrappers/role',
          ],
          }
        ]
    },
      {
        path: '/address',
        name: '地址管理',
        icon: 'EnvironmentOutlined',
        routes: [
          {
            path: '/address/index',
            name: '地址列表',
            component: '@/pages/address/index',
          }
        ]
    },
      {
        path: '/cart',
        name: '购物车管理',
        icon: 'ShoppingCartOutlined',
        routes: [
          {
            path: '/cart/index',
            name: '所有用户的购物车列表',
            component: '@/pages/cart/index',
          },
          {
            path: '/cart/kindindex',
            name: '区分用户的购物车',
            component: '@/pages/cart/kindindex',
          }
        ]
    },
      {
        path: '/order',
        name: '订单管理',
        icon: 'ShoppingCartOutlined',
        routes: [
          {
            path: '/order/index',
            name: '所有订单',
            component: '@/pages/order/index',
          },
          {
            path: '/order/changeOrder',
            component: '@/pages/order/changeOrder',
          }
        ]
    },
]